This sample demonstrates how to write an application that dumps out various information on the Open Transport TCP/IP protocol stack, much like the netstat program on UNIX.
Introduction
Open Transport is based on top of an industry standard STREAMS environment. Many of the networking features found in other STREAMS environments (such as UNIX SVR4) are also available in Open Transport, although the API for accessing these features in not exposed.
One of these features is the ability to generate a text report on the status of the TCP/IP protocol stack. On UNIX systems, this is typically done with the command line program netstat.
OTDumpInternetStatus is an attempt to bring this functionality to Mac OS. It’s a simple console-based program that prints a report of the status of the various TCP/IP protocol modules. It’s not intended for end users, but rather as sample code that tool vendors can incorporate into their applications.
Building the Code
This sample was built using the Metrowerks CodeWarrior Pro 1 environment and the Open Transport 1.3 SDK interfaces and libraries.
To rebuild the project, open it in CodeWarrior, change the “LatestInterfaces” and “LatestLibraries” access paths to point to the interfaces and libraries from the OT 1.3 (or newer) SDK, and choose Make from the Project menu.
Caveats
This sample uses the raw streams API provided in "OpenTptClient.h". All the routines in "OpenTptClient.h" can only be called from the native runtime architecture on a machine. As such, this code must be compiled for the classic RTA under 68K and for the PPC RTA on PPC. For more details, see DTS Q&A NW 48 “68K Open Transport Code on Power Macintoshes”:
<http://devworld.apple.com/dev/qa/nw/nw48.html>
Credits and Version History
If you find any problems with this sample, mail <DevSupport@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.
Version 1.0d1 (Feb 1998) was released to a small number of developers. It’s basically the same code as 1.0b1, but was distributed without documentation.
Version 1.0b1 (Mar 1998) is the first released version.